//
//  ShopDetailCellSectionView.m
//  FD
//
//  Created by Yasin on 2018/10/13.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import "ShopDetailCellSectionView.h"
//h  44
@interface ShopDetailCellSectionView()

/**上面的线*/
@property (nonatomic, strong) UIView *topLineView;
/**下面的线*/
@property (nonatomic, strong) UIView *bottomLineView;
@end

@implementation ShopDetailCellSectionView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    self.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.topLineView];
    [self addSubview:self.lb];
    [self addSubview:self.bottomLineView];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    
    //线
    [self.topLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(10);
        make.right.equalTo(self.mas_right).offset(-10);
        make.top.equalTo(self.mas_top);
        make.height.mas_equalTo(1);
    }];
    
    [self.lb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(10);
        make.size.mas_equalTo(CGSizeMake(120, 30));
        make.centerY.equalTo(self.mas_centerY);
    }];
    
    //线
    [self.bottomLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(10);
        make.right.equalTo(self.mas_right).offset(-10);
        make.height.mas_equalTo(1);
        make.bottom.equalTo(self.mas_bottom);
    }];
}

#pragma mark - line
- (UILabel *)lb {
    if (!_lb) {
        _lb = [UILabel new];
        _lb.font = [UIFont systemFontOfSize:15.0];
    }
    return _lb;
}

- (UIView *)topLineView {
    if (!_topLineView) {
        _topLineView = [UIView new];
        _topLineView.backgroundColor = kMainLightGrayColor;
    }
    return _topLineView;
}

- (UIView *)bottomLineView {
    if (!_bottomLineView) {
        _bottomLineView = [UIView new];
        _bottomLineView.backgroundColor = kMainLightGrayColor;
    }
    return _bottomLineView;
}

@end
